x86: early exception enhancement
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 20 Jun 2007 16:05:48 +0000 (17:05 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 20 Jun 2007 16:05:48 +0000 (17:05 +0100)
In order to at least have some minimal debuging capabilities when Xen
crashes really early, dump out registers and stack contents in a raw
form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/boot/x86_32.S
xen/arch/x86/boot/x86_64.S

index 1220f940a5721cce053053ed8ef689da0cc89ce5..4119d6ee1fd259f2899a1fd1b8f98dcb0629d610 100644 (file)
 
 /* This is the default interrupt handler. */
 int_msg:
-        .asciz "Unknown interrupt\n"
+        .asciz "Unknown interrupt (cr2=%08x)\n"
+hex_msg:
+        .asciz "  %08x"
         ALIGN
 ignore_int:
+        pusha
         cld
         mov     $(__HYPERVISOR_DS),%eax
         mov     %eax,%ds
         mov     %eax,%es
+        mov     %cr2,%eax
+        push    %eax
         pushl   $int_msg
         call    printk
+        add     $8,%esp
+        mov     %esp,%ebp
+0:      pushl   (%ebp)
+        add     $4,%ebp
+        pushl   $hex_msg
+        call    printk
+        add     $8,%esp
+        test    $0xffc,%ebp
+        jnz     0b
 1:      jmp     1b
 
 ENTRY(stack_start)
index d3c11b8788e8674c587063cf19c1d75b3119ee05..46c34c170257e7a5593d192e16aa502fc6233b40 100644 (file)
 
 /* This is the default interrupt handler. */
 int_msg:
-        .asciz "Unknown interrupt\n"
+        .asciz "Unknown interrupt (cr2=%016lx)\n"
+hex_msg:
+        .asciz "    %016lx"
 ignore_int:
-        cld
+        SAVE_ALL
+        movq    %cr2,%rsi
         leaq    int_msg(%rip),%rdi
         xorl    %eax,%eax
         call    printk
+        movq    %rsp,%rbp
+0:      movq    (%rbp),%rsi
+        addq    $8,%rbp
+        leaq    hex_msg(%rip),%rdi
+        xorl    %eax,%eax
+        call    printk
+        testq   $0xff8,%rbp
+        jnz     0b
 1:      jmp     1b